package unimelb.filesync.common.message;

import org.json.simple.JSONObject;

public class RequestPublicKey implements Jsonable {

    private final boolean isPublicKeyNeeded;

    public RequestPublicKey(boolean isPublicKeyNeeded) {
        super();
        this.isPublicKeyNeeded = isPublicKeyNeeded;
    }

    public boolean isPublicKeyNeeded() {
        return isPublicKeyNeeded;
    }

    @SuppressWarnings("unchecked")
    @Override
    public String toJson() {
        final JSONObject jsonObject = new JSONObject();
        jsonObject.put("isPublicKeyNeeded", isPublicKeyNeeded);
        return jsonObject.toJSONString();
    }
}
